
set(GTEST_ROOT $ENV{GTEST_ROOT})
enable_testing()
find_package(GTest REQUIRED)
find_package(Boost REQUIRED)

include_directories(
  ${Boost_INCLUDE_DIRS}
  ${GTEST_INCLUDE_DIRS}
  )

add_executable(echo echo.cc)
set_target_properties(echo PROPERTIES
  COMPILE_FLAGS "-std=c++0x -Wall"
  )
target_link_libraries(echo netbase)

add_executable(massive_svr massive_svr.cc)
set_target_properties(massive_svr PROPERTIES
  COMPILE_FLAGS "-std=c++0x -Wall"
  )
target_link_libraries(massive_svr netbase)

add_executable(massive_cli massive_cli.cc)
set_target_properties(massive_cli PROPERTIES
  COMPILE_FLAGS "-std=c++0x -Wall"
  )
target_link_libraries(massive_cli netbase)

add_executable(bit 
  bit.cc 
  ../msgutils/bit_writer.cc
  ../msgutils/bit_reader.cc
  )
set_target_properties(bit PROPERTIES
  COMPILE_FLAGS "-std=c++0x -Wall"
  )
target_link_libraries(bit ${GTEST_BOTH_LIBRARIES} pthread)

install(TARGETS 
  echo 
  massive_cli 
  massive_svr 
  bit 
  RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/bin
  )

install(FILES 
  ${CMAKE_CURRENT_LIST_DIR}/data 
  DESTINATION ${CMAKE_SOURCE_DIR}/bin
  )
